"""
    python 操作 mysql
"""

from pymysql import  Connection

# 构建数据库链接对象
connect = Connection(host="localhost",port=3306,user="root",password="root")

# mysql 的信息
print(connect.get_server_info())

# 获取 cursor 对象
cursor = connect.cursor()

# 选择数据库
connect.select_db("py_mysql")

cursor.execute("create table  test_mysql(id int)")


# 关闭链接
connect.close()